<template>
  <div id="app">
    <div class="logo">
      <img src="../assets/image/mem1.png" >
    </div>
    <div class="down_info">
      <p>{{version}}</p>
      <button type="button" name="button" class="down_bnt" @click.stop="downApp">下载</button>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'App',
    data () {
      return {
        version: '项目名称 for Android',
        iosLink: 'https://*************************&platform=ios',
        androidLink: 'https://*************************&platform=android',
        downloadLink: ''
      }
    },
    created () {
      if (this.isIOS()) {
        this.downloadLink = this.iosLink
        this.version = '项目名称 for Ios'
      } else {
        this.downloadLink = this.androidLink
        this.version = '项目名称 for Android'
      }
      // window.location.href= this.downloadLink
    },
    methods: {
      isIOS () {
        var u = navigator.userAgent
        return !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
      },
      downApp () {
        window.location.href = this.downloadLink
      }
    }
  }
</script>
